#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string s;
    string ans, tmp;
    cin >> s;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] >= '0' && s[i] <= '9')
        {
            tmp += s[i];
        }
        else
        {
            if (tmp.size() > ans.size())
            {
                ans = tmp;
            }
            tmp.clear();
        }
    }
    if (!tmp.empty())
    {
        if (tmp.size() > ans.size())
        {
            ans = tmp;
        }
    }
    cout << ans << endl;
    return 0;
}